import http from '@/api/request.js';

// 微信登录
export function wxTokenLogin(params = {}) {
  return http({
    url: '/sys/loginByMiniCode',
    method: 'get',
    params: params
  });
}

// 微信登录
export function wxLogin(params = {}) {
  return http({
    url: '/sys/loginByOpenid',
    method: 'get',
    params: params
  });
}

// 账号登录
export function submitLogin(params = {}) {
  return http({
    url: '/sys/miniLogin',
    method: 'post',
    params: params
  });
}

// getSessionKey
export function getSessionKey(params = {}) {
  return http({
    url: '/sys/getSessionKey',
    method: 'get',
    params: params
  });
}

// 获取手机号
export function getPhone(params = {}) {
  return http({
    url: '/sys/getPhoneNumber',
    method: 'post',
    params: params
  });
}

// 退出登录
export function miniLogout(params = {}) {
  return http({
    url: '/sys/miniLogout',
    method: 'get',
    params: params
  });
}

// 获取验证码
export function sendSms(params = {}) {
  return http({
    url: '/sys/miniSms',
    method: 'post',
    params: params
  });
}

// 验证码登录
export function miniPhoneLogin(params = {}) {
  return http({
    url: '/sys/miniPhoneLogin',
    method: 'post',
    params: params
  });
}
